#ifndef _IMAGE_PUSH_PUSHWITHRTSP_
#define _IMAGE_PUSH_PUSHWITHRTSP_

#include "../../../function.h"

namespace sp::Image::Push{
void register_pushWithRtsp();

/* 
    通过RTSP向服务器推流
*/
class pushWithRtsp: public Function{
private:
    std::string rtspUrl; // RTSP URL
    FILE* fp;            // ffmpeg进程文件描述符
    int fps;
    int height;
    int width;
    long index;
public:
    pushWithRtsp(std::vector<std::string> v);
    pushWithRtsp(std::string url, int fps, int width, int height);
    pushWithRtsp();
    virtual ~pushWithRtsp();
    static void registe();
    static Function* createObject(std::vector<std::string> params);
    static Function* createObject2();
    virtual void start();
    virtual bool waitForResource();
    virtual void process(std::vector<std::vector<Data*>>& data_input, std::vector<Data*>& data_output);
    virtual bool releaseResource();
    virtual void finish();
    virtual void copy(Function* other);
};

};

#endif